home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / ds5000.md / RCS / reloc.h,v < prev    next >
Encoding:
Text File  |  1989-11-12  |  4.6 KB  |  223 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     89.11.12.01.33.33;  author rab;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     89.11.12.01.30.29;  author rab;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @Added #ifdefs to make file idempotent.
  27. @
  28. text
  29. @/*    @@(#)reloc.h    4.2    (ULTRIX)    8/9/88                      */
  30. #ifdef _RELOC_H
  31. #ifdef mips
  32. /* --------------------------------------------------- */
  33. /* | Copyright (c) 1986 MIPS Computer Systems, Inc.  | */
  34. /* | All Rights Reserved.                            | */
  35. /* --------------------------------------------------- */
  36. /* $Header: /sprite/src/lib/include/ds3100.md/RCS/reloc.h,v 1.1 89/11/12 01:30:29 rab Exp Locker: rab $ */
  37.  
  38. /*    Copyright (c) 1984 AT&T    */
  39. /*      All Rights Reserved      */
  40.  
  41. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  42. /*    The copyright notice above does not evidence any       */
  43. /*    actual or intended publication of such source code.    */
  44.  
  45. #if mips
  46.  
  47. #ifdef LANGUAGE_C
  48. struct reloc {
  49.     long    r_vaddr;    /* (virtual) address of reference */
  50.     unsigned    r_symndx:24,    /* index into symbol table */
  51.         r_reserved:3,
  52.             r_type:4,    /* relocation type */
  53.         r_extern:1;    /* if 1 symndx is an index into the external
  54.                    symbol table, else symndx is a section # */
  55.     };
  56. #endif /* LANGUAGE_C */
  57.  
  58. #ifdef LANGUAGE_PASCAL
  59. type
  60.   reloc = packed record
  61.       r_vaddr : long;            /* (virtual) address of reference    */
  62.       r_symndx : 0..lshift(1, 24)-1;    /* index into symbol table         */
  63.       r_reserved : 0..7;
  64.       r_type : 0..15;            /* relocation type             */
  65.       r_extern : 0..1;            /* if 1, symndx is an index into the */
  66.                     /* external symbol table, else         */
  67.                     /* symndx is a section           # */
  68.       end {record};
  69. #endif /* LANGUAGE_PASCAL */
  70.  
  71. /*
  72.  * Section numbers for symndex for local relocation entries (r_extern == 0).
  73.  * For these entries the starting address for the section referenced by the
  74.  * section number is used in place of an external symbol table entry's value.
  75.  */
  76. #define    R_SN_NULL    0
  77. #define    R_SN_TEXT    1
  78. #define    R_SN_RDATA    2
  79. #define    R_SN_DATA    3
  80. #define    R_SN_SDATA    4
  81. #define    R_SN_SBSS    5
  82. #define    R_SN_BSS    6
  83. #define    R_SN_INIT    7
  84. #define    R_SN_LIT8    8
  85. #define    R_SN_LIT4    9
  86.  
  87. #else /* !defined(mips) */
  88.  
  89. struct reloc {
  90.     long    r_vaddr;    /* (virtual) address of reference */
  91.     long    r_symndx;    /* index into symbol table */
  92.     unsigned short    r_type;    /* relocation type */
  93.     };
  94. #endif /* mips */
  95.  
  96. /*
  97.  *   relocation types for all products and generics
  98.  */
  99.  
  100. /*
  101.  * All generics
  102.  *    reloc. already performed to symbol in the same section
  103.  */
  104. #define  R_ABS        0
  105.  
  106. /*
  107.  * Mips machines
  108.  *
  109.  *    16-bit reference
  110.  *    32-bit reference
  111.  *    26-bit jump reference
  112.  *    reference to high 16-bits
  113.  *    reference to low 16-bits
  114.  *    reference to global pointer reletive data item
  115.  *    reference to global pointer reletive literal pool item
  116.  */
  117. #define    R_REFHALF    1
  118. #define    R_REFWORD    2
  119. #define    R_JMPADDR    3
  120. #define    R_REFHI        4
  121. #define    R_REFLO        5
  122. #define    R_GPREL        6
  123. #define    R_LITERAL    7
  124.  
  125. /*
  126.  * X86 generic
  127.  *    8-bit offset reference in 8-bits
  128.  *    8-bit offset reference in 16-bits
  129.  *    12-bit segment reference
  130.  *    auxiliary relocation entry
  131.  */
  132. #define    R_OFF8        07
  133. #define R_OFF16        010
  134. #define    R_SEG12        011
  135. #define    R_AUX        013
  136.  
  137. /*
  138.  * B16 and X86 generics
  139.  *    16-bit direct reference
  140.  *    16-bit "relative" reference
  141.  *    16-bit "indirect" (TV) reference
  142.  */
  143. #define  R_DIR16    01
  144. #define  R_REL16    02
  145. #define  R_IND16    03
  146.  
  147. /*
  148.  * 3B generic
  149.  *    24-bit direct reference
  150.  *    24-bit "relative" reference
  151.  *    16-bit optimized "indirect" TV reference
  152.  *    24-bit "indirect" TV reference
  153.  *    32-bit "indirect" TV reference
  154.  */
  155. #define  R_DIR24    04
  156. #define  R_REL24    05
  157. #define  R_OPT16    014
  158. #define  R_IND24    015
  159. #define  R_IND32    016
  160.  
  161. /*
  162.  * 3B and M32 || u3b15 || u3b5 || u3b2 generics
  163.  *    32-bit direct reference
  164.  */
  165. #define  R_DIR32    06
  166.  
  167. /*
  168.  * M32 || u3b15 || u3b5 || u3b2 generic
  169.  *    32-bit direct reference with bytes swapped
  170.  */
  171. #define  R_DIR32S    012
  172.  
  173. /*
  174.  * DEC Processors  VAX 11/780 and VAX 11/750
  175.  *
  176.  */
  177.  
  178. #define R_RELBYTE    017
  179. #define R_RELWORD    020
  180. #define R_RELLONG    021
  181. #define R_PCRBYTE    022
  182. #define R_PCRWORD    023
  183. #define R_PCRLONG    024
  184.  
  185. /*
  186.  * Motorola 68000
  187.  *
  188.  * ... uses R_RELBYTE, R_RELWORD, R_RELLONG, R_PCRBYTE and R_PCRWORD as for
  189.  * DEC machines above.
  190.  */
  191.  
  192. #define    RELOC    struct reloc
  193. #define    RELSZ    sizeof(RELOC)
  194.  
  195.     /* Definition of a "TV" relocation type */
  196.  
  197. #if N3B
  198. #define ISTVRELOC(x)    ((x==R_OPT16)||(x==R_IND24)||(x==R_IND32))
  199. #endif
  200. #if B16 || X86
  201. #define ISTVRELOC(x)    (x==R_IND16)
  202. #endif
  203. #if M32 || u3b15 || u3b5 || u3b2
  204. #define ISTVRELOC(x)    (x!=x)    /* never the case */
  205. #endif
  206. #endif /* mips */
  207. #endif /* _RELOC_H */
  208.  
  209. @
  210.  
  211.  
  212. 1.1
  213. log
  214. @Initial revision
  215. @
  216. text
  217. @d2 1
  218. d8 1
  219. a8 1
  220. /* $Header: reloc.h,v 1031.2 88/05/16 14:39:52 bettina Exp $ */
  221. d179 2
  222. @
  223.